<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<link rel="stylesheet" type="text/css" href="<%=path%>/css/table.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/css/app.css"/>

<div id="menubar">
    <img src="<%=path%>/images/left.png" style="margin-top:auto;margin-bottom:auto;width:15px; height:15px"><a
        href="<%=path%>/reader/bookSearch.jsp">图书查询</a>
    <img src="<%=path%>/images/left.png" style="margin-top:auto;margin-bottom:auto;width:15px; height:15px">搜索结果
</div>
<s:if test="#session.loginState == 1">
    <table class="default" width="75%" style="margin-top:20px;margin-left: 20px">
        <col width="10%">
        <col width="10%">
        <col width="10%">
        <col width="10%">
        <col width="5%">
        <col width="5%">
        <col width="10%">
        <col width="5%">
        <col width="5%">
        <col width="5%">
        <tr class="title">
            <td style="text-align:center">图书编号</td>
            <td style="text-align:center">书名</td>
            <td style="text-align:center">作者</td>
            <td style="text-align:center">出版社</td>
            <td style="text-align:center">类型</td>
            <td style="text-align:center">价格</td>
            <td style="text-align:center">入库时间</td>
            <td style="text-align:center">馆藏数量</td>
            <td style="text-align:center">出借数量</td>
            <td style="text-align:center">丢失数量</td>
        </tr>

        <!-- 遍历开始 -->
        <s:iterator value="#session.bookSearchResult" var="book">
            <tr class="list">
                <td style="text-align:center"><s:property value="#book.bookid"/></td>
                <td style="text-align:center"><s:property value="#book.bookname"/></td>
                <td style="text-align:center"><s:property value="#book.author"/></td>
                <td style="text-align:center"><s:property value="#book.publishing"/></td>
                <td style="text-align:center"><s:property value="#book.bookCategory.category"/></td>
                <td style="text-align:center"><s:property value="#book.price"/></td>
                <td style="text-align:center"><s:date name="#book.datein" format="yyyy-MM-dd"/></td>
                <td style="text-align:center"><s:property value="#book.quantityin"/></td>
                <td style="text-align:center"><s:property value="#book.quantityout"/></td>
                <td style="text-align:center"><s:property value="#book.quantityloss"/></td>
            </tr>
        </s:iterator>
    </table>
</s:if>
<s:else>
    <table width="100%" style="margin-top:50px;">
        <tr>
            <td>
                <h2 style="text-align: center">请使用读者账号登录！</h2>
            </td>
        </tr>
    </table>
</s:else>
</html>
